class Cashier(object):

    def __init__(self, n, discount, products, prices):
        """
        :type n: int
        :type discount: int
        :type products: List[int]
        :type prices: List[int]
        """
        self.n = n
        self.count = 0
        self.d = 1 - discount / 100
        self.p = {}
        for i in range(len(prices)):
            self.p[products[i]] = prices[i]

    def getBill(self, product, amount):
        """
        :type product: List[int]
        :type amount: List[int]
        :rtype: float
        """
        ans = 0
        for i in range(len(product)):
            ans += amount[i] * self.p[product[i]]
        self.count += 1
        if self.count == self.n:
            self.count = 0
            ans *= self.d
        return ans